<template>
<h1>El-单选组件</h1>
  <el-radio-group v-model="edu">
    <el-radio value="苹果" label="苹果"></el-radio>
    <el-radio value="香蕉" label="香蕉"></el-radio>
    <el-radio value="梨子" >梨子</el-radio>
    <el-radio value="葡萄" >葡萄</el-radio>
  </el-radio-group>
  <h4>选择的水果是:{{edu}}</h4>
  <hr>
  <el-radio-group v-model="res">
    <el-radio-button v-for="item in arr" :value="item.age" :label="item.name"></el-radio-button>
  </el-radio-group>
  <h3>选中人的年龄是:{{res}}</h3>
</template>
<script setup>
import {ref} from "vue";

const edu = ref('');

const res = ref(24)
const arr = ref([
  {name:'张三',age:20},
  {name:'李四',age:18},
  {name:'王五',age:30},
  {name:'赵六',age:24},
  {name:'来福',age:25}
]);

</script>

<style scoped>

</style>